<template>
  <div class="home">
    <div class="container">
      <Swiper />
      <Files />
      <Scheme />
      <HomeTitle class="border">
        <h1 slot="title">
          时令好文
        </h1>
      </HomeTitle>
      <HomeList
        v-for="(v) in arra"
        :key="v.seasonid"
        :text="v.text"
        :readcount="v.readcount"
        :imgurl="v.imgurl"
        :date="v.date"
      />
      <HomeTitle class="hometitle">
          <h1 slot="title">调养妙方</h1>
          <h2 slot="up">查看更多〉</h2>
      </HomeTitle>
      
        <Recuphome/>
      
      <HomeList
        v-for="(v) in arrb"
        :key="v.seasonid"
        :text="v.text"
        :readcount="v.readcount"
        :imgurl="v.imgurl"
        :date="v.date"
      />
    </div>
    <Footer />
  </div>
</template>

<script>
import getlink from "@/api/getlink.js";
import Swiper from "../components/swiper.vue";
import Files from "../components/files.vue";
import Scheme from "../components/scheme.vue";
import HomeList from "../components/homeList.vue";
import HomeTitle from "../components/homeTitle.vue";
import Recuphome from "../components/recuphome.vue";

export default {
  data() {
    return {
      arra: [],
      arrb: [],
      
    };
  },
  components: {
    Swiper,
    Files,
    Scheme,
    HomeList,
    Recuphome,
    HomeTitle
  },
  created() {
    getlink("/data/list/xiaoming").then((ok) => {
      // console.log(ok.data.homeseason);

      this.arra = ok.data.homeseason.filter((item) => {
        return item.title == "t1";
      });
      // console.log(this.arra);
      this.arrb = ok.data.homeseason.filter((item) => {
        return item.title == "t2";
      });
      // console.log(this.arrb);
      this.arrc=ok.data.recuphome
    });
  }
};
</script>

<style scoped>
.container {
  margin-bottom: 0.6rem;
}
h1{
  font-size: .18rem;
  font-weight: 700;
}
.hometitle{
  background-color: rgb(247, 243, 243);
}
h2{
  color: #999;
}
.border{
    border-bottom: 0.01rem solid #999;
}
</style>